//
//  ActivityCell.m
//  UI 作业 - 豆瓣电影
//
//  Created by hesiyao on 15/12/22.
//  Copyright © 2015年 www.lanou3g.com蓝鸥科技. All rights reserved.
//

#import "ActivityCell.h"

@implementation ActivityCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backView = [[UIImageView alloc] init];
        [self.contentView addSubview:_backView];
        
        self.secView = [[UIImageView alloc] init];
        [self.backView addSubview:_secView];
//        _secView.layer.cornerRadius = 10;
//        self.clipsToBounds = YES;
//        _secView.backgroundColor = [UIColor grayColor];
//        _secView.backgroundColor = [UIColor redColor];
        
        self.pictureView = [[UIImageView alloc] init];
        [self.secView addSubview:_pictureView];
        _pictureView.backgroundColor = [UIColor redColor];
        
        self.timeView = [[UIImageView alloc] init];
        [self.secView addSubview:_timeView];
//        _timeView.backgroundColor = [UIColor redColor];
        
        self.addressView = [[UIImageView alloc] init];
        [self.secView addSubview:_addressView];
//        _addressView.backgroundColor = [UIColor redColor];
        
        self.categoryView = [[UIImageView alloc] init];
        [self.secView addSubview:_categoryView];
//        _categoryView.backgroundColor = [UIColor redColor];
        
        self.titleLabel = [[UILabel alloc] init];
        [self.backView addSubview:_titleLabel];
//        _titleLabel.backgroundColor = [UIColor yellowColor];
        
        self.addressLabel = [[UILabel alloc] init];
        [self.secView addSubview:_addressLabel];
//        _addressLabel.backgroundColor = [UIColor yellowColor];
        
        self.timeLabel = [[UILabel alloc] init];
        [self.secView addSubview:_timeLabel];
//        _timeLabel.backgroundColor = [UIColor yellowColor];
        
        self.categoryLabel = [[UILabel alloc] init];
        [self.secView addSubview:_categoryLabel];
//        _categoryLabel.backgroundColor = [UIColor yellowColor];
        
        self.wisherLabel = [[UILabel alloc] init];
        [self.secView addSubview:_wisherLabel];
//        _wisherLabel.textColor = [UIColor redColor];
//        _wisherLabel.backgroundColor = [UIColor yellowColor];
        
        self.partLabel = [[UILabel alloc] init];
        [self.secView addSubview:_partLabel];
//        _partLabel.textColor = [UIColor redColor];
//        _partLabel.backgroundColor = [UIColor yellowColor];
        
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    _backView.frame = CGRectMake(20, 20, self.contentView.frame.size.width - 40, self.contentView.frame.size.height - 40);
    _secView.frame = CGRectMake(0, 40, _backView.frame.size.width, _backView.frame.size.height - 40);
    _titleLabel.frame = CGRectMake(10, 0, _backView.frame.size.width - 20, 40);
    _timeView.frame = CGRectMake(10, 10, 30, 30);
    _timeLabel.frame = CGRectMake(50, 10, 100, 30);
    _addressView.frame  = CGRectMake(10, 50, 30, 30);
    _addressLabel.frame = CGRectMake(50, 50, 100, 30);
    _categoryView.frame = CGRectMake(10, 90, 30, 30);
    _categoryLabel.frame = CGRectMake(50, 90, 100, 30);
    _wisherLabel.frame = CGRectMake(10, 140, 100, 30);
    _partLabel.frame = CGRectMake(120, 140, 100, 30);
    _pictureView.frame = CGRectMake(_secView.frame.size.width - self.contentView.frame.size.width / 4 - 20, 10, self.contentView.frame.size.width / 4 + 10, _secView.frame.size.height - 20);
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
